home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d8
/
xmodem31.arc
/
XMODEM.DOC
< prev
next >
Wrap
Text File
|
1991-01-10
|
7KB
|
165 lines
/*
*
*
* XMODEM.EXE
* Version 3.1
* ----------
*
*
* This is a special implementation of the XMODEM protocol transfer. It runs
* "beneath" Crosstalk, and in invoked via the Crosstalk "RUN" command.
*
* CHANGES IN REVERSE ORDER:
* ------- -- ------- -----
*
* 7/10/85 - While preparing v3.0, we broke the CRC routines. They
* have been fixed. ANY v3.0 COPIES THAT ARE FLOATING
* AROUND HAVE BAD CRC CODE! DESTROY THEM!
*
* Moral: If it ain't broke, don't fix it.
*
* 6/29/85 - Added commline I/O error checking. Overrun, Framing, and
* v 3.0 Parity errors cause bad block. In short, we're no longer
* relying only on checksum or CRC. Don't ask me how you
* can get a Parity Error when you're running 8N1...
*
* Pulled initial purge of commline chars. While this is
* exceedingly safe, it is a pain in the neck 'cause it
* swallows the first NAK. Things go quicker this way.
* This also gives a greater chance of catching the other
* side's "C" CRC request and thus enabling CRC checking.
*
* 6/24/85 - Fixed RS232 support routines (assembler) to stay in
* v 2.1 IRQ loop until IIR shows no more interrupts pending.
* See rather lengthy explanation below.
*
* 3/03/85 - Initial version.
*
*
* HISTORY:
* --------
*
* Crosstalk STILL doesn't work right with XMODEM, especially sending files
* (Crosstalk's XX command). And neither the send nor the receive (RX)
* commands recognize the CRC option, which would greatly improve reliability.
* So this stand-alone version of XMODEM was developed as an add-on Crosstalk
* command. It uses CRC if the other side can support it, else uses the
* usual 8-bit checksum.
*
*
* USE:
* ----
*
* 1) While online to the remote system via Crosstalk terminal mode,
* start the other XMODEM transfer, just as you would do in preparation
* for using Crosstalk's RX or XX commands.
*
* 2) Get to Crosstalk's COMMAND? prompt (via ESC or whatever key you've
* set up as the ATtention key).
*
* 3) Use the Crosstalk RUN command to run this XMODEM to actually do the
* file transfer:
*
* RUn xmodem 1 s foo (send "foo" using port 1)
* RUn xmodem 1 r b:xyz (receive "b:xyz" using port 1)
* RUn xmodem 2 r xmodem.c (receive "xmodem.c" using port 2)
*
* 4) As the transfer proceeds, you will see status messages on your screen.
*
* 5) When the transfer is complete, you will be returned to Crosstalk.
*
* Things are made easier if you put the invariant part of the command into
* a function key within Crosstalk. Mine are set up as follows:
*
* FK 1 "@RUn c:xmodem 1 s " (F1 = send a file)
* FK 2 "@RUn c:xmodem 1 r " (F2 = receive a file)
*
* Then you just have to fill in the filename. From within Crosstalk all I
* have to do to receive "foo.exe", for instance, is press:
*
* <F2>foo.exe<RETURN>
*
* which Crosstalk translates into a DOS command of C:XMODEM 1 R FOO.EXE
*
*
* RECOMMENDATIONS:
* ---------------
*
* When you use the RUN command within Crosstalk, DOS has to load
* TWO programs - COMMAND.COM and the one that you're RUNning. So
* I strongly recommend that both COMMAND.COM and XMODEM.EXE reside on
* ramdisk. Things really move when it's set up like that, and can be
* rather pokey (thanks to DOS' file-opening code) if not.
*
* Maybe someday Crosstalk will have a cleaner interface to external
* programs than this RUN thing. On my system I have XMODEM, KERMIT,
* COMPUSERVE and MNP protocols, all implemented via this RUN thing.
* And each time I drop into one of them, I have to wait the second
* or so that it takes DOS to load COMMAND.COM and the program itself
* from my ramdisk. Are you listening, Microstuf???
*
*
* CAVEATS:
* -------
*
* NOTE: Do not - repeat DO NOT - attempt to run this as a stand-alone transfer
* program (i.e. - outside of Crosstalk). It has some very touchy and difficult
* code that was specially developed just to allow "re-using" the serial port
* without actually opening it. This program wants to use the same baud rate and
* data structure that Crosstalk has already set up. So it doesn't set these.
* It just (CAREFULLY) massages the 8250 and 8259 so that while this program
* is running it has full input AND output interrupt-driven access to the port,
* without disturbing the environment (hardware/software) set up by Crosstalk.
*
* If you run this without first having "opened" the serial port (by running
* Crosstalk etc), then the 8250 will very likely go haywire.
*
* Just don't.
*
*
* - Joan Riff, 3 March 1985
*
*
* 6/24/85 - Version 2.1 Notes:
* ===========================
*
* Bob Baumann found a very subtle but fatal feature of the Hayes
* 1200b internal modem. Unlike a standard 8250, the one on the
* 1200b DOES NOT present one and only one IIR value per IRQ. Instead,
* it presents the next-lower-priority IIR value AT THE VERY INSTANT
* THAT THE CAUSE OF THE FIRST IS CLEARED BY THE IRQ ROUTINE. And
* I do mean the very instant (like between instructions). We haven't
* pulled a 1200b apart to see what's tied to the IIR bits, but it
* looks like their 8250 is specially hooked to their modem, so
* that the thing can present up to 4 separate "interrupts" per one
* PC IRQ.
*
* I have heard from 1200b users who reported unspecified "problems"
* using this program under Crosstalk. No wonder! If the 1200b gets
* a parity error while receiving characters, for example,
* then its 8250 will do one IRQ for the LSR, AND THEN IMMEDIATELY
* PRESENT AN IIR FOR THE RECEIVED CHAR. Until that "received data
* available" state is cleared, the 8250 stays in the interrupted
* state.
*
* Standard 8250's (i.e. - all that I've seen except for Hayes') will
* issue a second IRQ for the second condition.
*
* There are many IIR combinations that cause a fatal lockup of the
* 8250 when used the way Hayes is using it. Thus neither XMODEM.EXE
* nor Crosstalk can get chars in or out of the 8250. Only solution
* was to exit Crosstalk and restart it (so that it would init the
* 8250).
*
* The RS232 interface code has been changed in release 2.1 to
* expect more than 1 IIR value per IRQ. This solves the problem.
* Why fight it? So much for clean, interrupt-driven code. Sigh...
*
*
* - Joan Riff 6/24/85
*
*/